#pragma once
#include "Fourier.h"


class CircleDivider
{
	static const int kMaxNumberOfSegments = 2 * kMaxDegree + 1;

	DirectX::XMVECTOR mColors[kMaxNumberOfSegments];
	float mTransitionAngles[kMaxNumberOfSegments + 1];
	int mCount;


public:
	void ResetSegments(const Fourier&);
	void MergeSegments(const Fourier&);
	float Adjust(const Fourier&, int& outIterations);

	int GetNumberOfSegments() const;

	// the index i may be equal to the number of segments:
	// in that case angle = angle[0] + 2*M_PI.
	float GetAngleAtIndex(int i) const;

	COLORREF GetColorAtIndex(int i) const;
	
private:

	void MakeRawSegmentation(const Fourier&);
};

